package org.merka.cryptochat.controller;

import java.util.List;

import org.merka.cryptochat.dao.IUserManager;
import org.merka.cryptochat.entity.ChatUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller(value = "/rest")
public class RESTServicesController
{
	public static final String ENTER = "/enter";
	public static final String CHAT_VIEW = "chatView";
	public static final String USER_PATH = "/user";
	public static final String ALL_PATH = "/all";
	
	@Autowired
	private IUserManager userManager;
	
	public IUserManager getUserManager()
	{
		return userManager;
	}

	public void setUserManager(IUserManager userManager)
	{
		this.userManager = userManager;
	}

	@RequestMapping(RESTServicesController.USER_PATH + RESTServicesController.ALL_PATH)
	public @ResponseBody List<ChatUser> getAllUsers()
	{
		return getUserManager().getUsersList();
	}
}
